Namespace persistent.DataLoad.ConfigurationProviders

    Public Interface ISimpleDataloadConfigurationProvider

        ReadOnly Property DataFileHeader() As String

        ReadOnly Property DataLineTemplate() As String

        ReadOnly Property DataPartSeperator() As Char

        ReadOnly Property DatalineValidationExpression() As String 'Implements IDataLoadRuler.InputValidationExpression


        ReadOnly Property ModuleName() As String

        ReadOnly Property DataTableName() As String

        ReadOnly Property InputEncoding() As System.Text.Encoding

        ReadOnly Property OutputEncoding() As System.Text.Encoding

        ReadOnly Property StartLineIndex() As Integer

        ReadOnly Property LineCountToRead() As Integer

        ReadOnly Property RunningMode() As DataLoadRunningModes

        Sub SetRunningMode(ByVal mode As DataLoadRunningModes)

    End Interface




    Public Class SimpleDataloadConfigurationProvider
        Implements ISimpleDataloadConfigurationProvider

        Private _ModuleName As String
        Private _DataTableName As String
        Private _DataFileHeader As String
        Private _DataLineTemplate As String
        Private _DataPartSeperator As Char
        Private _DatalineValidationExpression As String
        Private _InputEncoding As System.Text.Encoding
        Private _OutputEncoding As System.Text.Encoding
        Private _StartLineIndex As Integer
        Private _LineCountToRead As Integer
        Private _RunningMode As DataLoadRunningModes

        Public Sub New _
        ( _
            ByVal moduleName As String, _
            ByVal dataTableName As String, _
            ByVal dataFileHeader As String, _
            ByVal dataLineTemplate As String, _
            ByVal dataPartSeperator As Char, _
            ByVal datalineValidationExpression As String, _
            ByVal inputEncoding As System.Text.Encoding, _
            ByVal outputEncoding As System.Text.Encoding, _
            ByVal startLineIndex As Integer, _
            ByVal lineCountToRead As Integer _
        )
            Me._ModuleName = moduleName
            Me._DataTableName = dataTableName
            Me._DataFileHeader = dataFileHeader
            Me._DataLineTemplate = dataLineTemplate
            Me._DataPartSeperator = dataPartSeperator
            Me._DatalineValidationExpression = datalineValidationExpression
            Me._InputEncoding = inputEncoding
            Me._OutputEncoding = outputEncoding
            Me._StartLineIndex = startLineIndex
            Me._LineCountToRead = lineCountToRead
        End Sub




        Public ReadOnly Property ModuleName() As String Implements ISimpleDataloadConfigurationProvider.ModuleName
            Get
                Return Me._ModuleName
            End Get
        End Property

        Public ReadOnly Property DataTableName() As String Implements ISimpleDataloadConfigurationProvider.DataTableName
            Get
                Return Me._DataTableName
            End Get
        End Property

        Public ReadOnly Property DataFileHeader() As String Implements ISimpleDataloadConfigurationProvider.DataFileHeader
            Get
                Return Me._DataFileHeader
            End Get
        End Property

        Public ReadOnly Property DataLineTemplate() As String Implements ISimpleDataloadConfigurationProvider.DataLineTemplate
            Get
                Return Me._DataLineTemplate
            End Get
        End Property

        Public ReadOnly Property DataPartSeperator() As Char Implements ISimpleDataloadConfigurationProvider.DataPartSeperator
            Get
                Return Me._DataPartSeperator
            End Get
        End Property

        Public ReadOnly Property DatalineValidationExpression() As String Implements ISimpleDataloadConfigurationProvider.DatalineValidationExpression
            Get
                Return Me._DatalineValidationExpression
            End Get
        End Property

        Public ReadOnly Property InputEncoding() As System.Text.Encoding Implements ISimpleDataloadConfigurationProvider.InputEncoding
            Get
                Return Me._InputEncoding
            End Get
        End Property

        Public ReadOnly Property OutputEncoding() As System.Text.Encoding Implements ISimpleDataloadConfigurationProvider.OutputEncoding
            Get
                Return Me._OutputEncoding
            End Get
        End Property

        Public ReadOnly Property StartLineIndex() As Integer Implements ISimpleDataloadConfigurationProvider.StartLineIndex
            Get
                Return Me._StartLineIndex
            End Get
        End Property

        Public ReadOnly Property LineCountToRead() As Integer Implements ISimpleDataloadConfigurationProvider.LineCountToRead
            Get
                Return Me._LineCountToRead
            End Get
        End Property

        Public ReadOnly Property RunningMode() As DataLoadRunningModes Implements ISimpleDataloadConfigurationProvider.RunningMode
            Get
                Return Me._RunningMode
            End Get
        End Property

        Public Sub SetRunningMode(ByVal mode As DataLoadRunningModes) Implements ISimpleDataloadConfigurationProvider.SetRunningMode
            Me._RunningMode = mode
        End Sub

    End Class

    Public NotInheritable Class FaturaSokuDataLoadConfigurationProvider
        Implements ISimpleDataloadConfigurationProvider
        Private _InputEncoding As System.Text.Encoding
        Private _OutputEncoding As System.Text.Encoding
        Private _RunningMode As DataLoadRunningModes
        Private _EvalLineCount As Integer = -1

        Public ReadOnly Property DataFileHeader() As String Implements ISimpleDataloadConfigurationProvider.DataFileHeader
            Get
                Return "LOAD DATA" & _
                vbNewLine & "INFILE *" & _
                vbNewLine & "APPEND INTO TABLE eu_bill.fs_usages" & _
                vbNewLine & "fields terminated by ';' OPTIONALLY ENCLOSED BY '""' TRAILING NULLCOLS" & _
                vbNewLine & "(" & _
                vbNewLine & "CUTOFF ""REPLACE ( TO_CHAR(:CUTOFF), '.', '' )"", " & _
                vbNewLine & "PERIOD, " & _
                vbNewLine & "MSISDN, " & _
                vbNewLine & "CUSTOMER_ID, " & _
                vbNewLine & "FIRST_NAME, " & _
                vbNewLine & "LAST_NAME, " & _
                vbNewLine & "CURRENT_TARIFF_ID, " & _
                vbNewLine & "CURRENT_TARIFF, " & _
                vbNewLine & "BILL_AMOUNT, " & _
                vbNewLine & "MAX_AMOUNT_TYPE, " & _
                vbNewLine & "MAX_AMOUNT, " & _
                vbNewLine & "MONTHLY_FEE, " & _
                vbNewLine & "DATA_REV, " & _
                vbNewLine & "DATA_MB, " & _
                vbNewLine & "SMS_REV, " & _
                vbNewLine & "SMS_ONNET_ADEDI, " & _
                vbNewLine & "SMS_OFFNET_ADEDI, " & _
                vbNewLine & "NTVOICE_REV, " & _
                vbNewLine & "VOICE_NONINTERCOM_MOU, " & _
                vbNewLine & "VOICE_INTERCOM_MOU, " & _
                vbNewLine & "VOICE_ONNET_MOU, " & _
                vbNewLine & "VOICE_OTHGSM_MOU, " & _
                vbNewLine & "VOICE_PSTN_MOU, " & _
                vbNewLine & "VOICE_OFFNET_MOU, " & _
                vbNewLine & "ROAMING_REV, " & _
                vbNewLine & "ROAMING_REV_VOICE_IN_MOU, " & _
                vbNewLine & "ROAMING_REV_VOICE_OUT_MOU, " & _
                vbNewLine & "ROAMING_REV_SMS_ADEDI, " & _
                vbNewLine & "ROAMING_REV_DATA_MB, " & _
                vbNewLine & "INT_REV, " & _
                vbNewLine & "INT_REV_VOICE_MOU, " & _
                vbNewLine & "INT_REV_SMS_ADEDI, " & _
                vbNewLine & "OTHER_REV, " & _
                vbNewLine & "FIRST_OFFER         CHAR(500)  NULLIF FIRST_OFFER=BLANKS," & _
                vbNewLine & "FIRST_OFFER_SCREEN_INFO         CHAR(500)  NULLIF FIRST_OFFER_SCREEN_INFO=BLANKS," & _
                vbNewLine & "FIRST_OFFER_ACCEPTED_REV," & _
                vbNewLine & "SECOND_OFFER         CHAR(500)  NULLIF SECOND_OFFER=BLANKS," & _
                vbNewLine & "SECOND_OFFER_RETURN_AMOUNT," & _
                vbNewLine & "SECOND_OFFER_SCREEN_INFO         CHAR(500)  NULLIF SECOND_OFFER_SCREEN_INFO=BLANKS," & _
                vbNewLine & "SECOND_OFFER_ACCEPTED_REV," & _
                vbNewLine & "THIRD_OFFER         CHAR(500)  NULLIF THIRD_OFFER=BLANKS," & _
                vbNewLine & "THIRD_OFFER_RETURN_AMOUNT," & _
                vbNewLine & "THIRD_OFFER_SCREEN_INFO         CHAR(500)  NULLIF THIRD_OFFER_SCREEN_INFO=BLANKS," & _
                vbNewLine & "OFFER_RETURN_TYPE, " & _
                vbNewLine & "BILL_AMOUNT_LM, " & _
                vbNewLine & "MAX_AMOUNT_TYPE_LM, " & _
                vbNewLine & "MAX_AMOUNT_LM, " & _
                vbNewLine & "MONTHLY_FEE_LM, " & _
                vbNewLine & "DATA_REV_LM, " & _
                vbNewLine & "DATA_MB_LM, " & _
                vbNewLine & "SMS_REV_LM, " & _
                vbNewLine & "SMS_ONNET_ADEDI_LM, " & _
                vbNewLine & "SMS_OFFNET_ADEDI_LM, " & _
                vbNewLine & "NTVOICE_REV_LM, " & _
                vbNewLine & "VOICE_NONINTERCOM_MOU_LM, " & _
                vbNewLine & "VOICE_INTERCOM_MOU_LM, " & _
                vbNewLine & "VOICE_ONNET_MOU_LM, " & _
                vbNewLine & "VOICE_OTHGSM_MOU_LM, " & _
                vbNewLine & "VOICE_PSTN_MOU_LM, " & _
                vbNewLine & "VOICE_OFFNET_MOU_LM, " & _
                vbNewLine & "ROAMING_REV_LM, " & _
                vbNewLine & "ROAMING_REV_VOICE_IN_MOU_LM, " & _
                vbNewLine & "ROAMING_REV_VOICE_OUT_MOU_LM, " & _
                vbNewLine & "ROAMING_REV_SMS_ADEDI_LM, " & _
                vbNewLine & "ROAMING_REV_DATA_MB_LM, " & _
                vbNewLine & "INT_REV_LM, " & _
                vbNewLine & "INT_VOICE_MOU_LM, " & _
                vbNewLine & "INT_SMS_ADEDI_LM, " & _
                vbNewLine & "OTHER_REV_LM, " & _
                vbNewLine & "TARIFE_GRUBU, " & _
                vbNewLine & "OFFER1, " & _
                vbNewLine & "OFFER2, " & _
                vbNewLine & "OFFER3" & _
                vbNewLine & ")" & _
                vbNewLine & "BEGINDATA"

            End Get
        End Property

        Public ReadOnly Property DataLineTemplate() As String Implements ISimpleDataloadConfigurationProvider.DataLineTemplate
            Get
                Return "{0};{1};{2};{3};{4};{5};{6};{7};{8};{9};{10};{11};{12};{13};{14};{15};{16};{17};{18};{19};{20};{21};{22};{23};{24};{25};{26};{27};{28};{29};{30};{31};{32};{33};{34};{35};{36};{37};{38};{39};{40};{41};{42};{43};{44};{45};{46};{47};{48};{49};{50};{51};{52};{53};{54};{55};{56};{57};{58};{59};{60};{61};{62};{63};{64};{65};{66};{67};{68};{69};{70};{71};{72};"
            End Get
        End Property

        Public ReadOnly Property DatalineValidationExpression() As String Implements ISimpleDataloadConfigurationProvider.DatalineValidationExpression
            Get
                Return ""
            End Get
        End Property

        Public ReadOnly Property DataPartSeperator() As Char Implements ISimpleDataloadConfigurationProvider.DataPartSeperator
            Get
                Return ","c
            End Get
        End Property

        Public ReadOnly Property DataTableName() As String Implements ISimpleDataloadConfigurationProvider.DataTableName
            Get
                Return "eu_bill.fs_usages"
            End Get
        End Property

        Public ReadOnly Property ModuleName() As String Implements ISimpleDataloadConfigurationProvider.ModuleName
            Get
                Return "fs"
            End Get
        End Property

        Public ReadOnly Property InputEncoding() As System.Text.Encoding Implements ISimpleDataloadConfigurationProvider.InputEncoding
            Get
                Return Me._InputEncoding
            End Get
        End Property

        Public ReadOnly Property OutputEncoding() As System.Text.Encoding Implements ISimpleDataloadConfigurationProvider.OutputEncoding
            Get
                Return Me._OutputEncoding
            End Get
        End Property

        Public ReadOnly Property StartLineIndex() As Integer Implements ISimpleDataloadConfigurationProvider.StartLineIndex
            Get
                Return 1
            End Get
        End Property

        Public ReadOnly Property LineCountToRead() As Integer Implements ISimpleDataloadConfigurationProvider.LineCountToRead
            Get
                Return Me._EvalLineCount
            End Get
        End Property

        Public ReadOnly Property RunningMode() As DataLoadRunningModes Implements ISimpleDataloadConfigurationProvider.RunningMode
            Get
                Return Me._RunningMode
            End Get
        End Property

        Public Sub SetRunningMode(ByVal mode As DataLoadRunningModes) Implements ISimpleDataloadConfigurationProvider.SetRunningMode
            Me._RunningMode = mode

            If mode = DataLoadRunningModes.Eval Then
                Me._EvalLineCount = 10
            End If

        End Sub

        Public Function SetInputEncoding(ByVal encoding As System.Text.Encoding)
            Me._InputEncoding = encoding
        End Function

        Public Function SetOutputEncoding(ByVal encoding As System.Text.Encoding)
            Me._OutputEncoding = encoding
        End Function

    End Class


    Public Enum DataLoadRunningModes
        Eval
        Real
    End Enum

End Namespace
